﻿@model SingleBlog.Core.SettingModels.SmtpSettingModel
@{
    ViewBag.Title = "SMTP 设置";
}
<ul class="nav nav-pills mb-3">
    <li class="nav-item "><a asp-action="Smtp" class="nav-link">Smtp 配置</a></li>
    <li class="nav-item "><a asp-action="SmtpTest" class="nav-link active">发送测试邮件</a></li>
</ul>
<form method="post">
    @if (ViewContext.ModelState.ErrorCount > 0)
    {
        <div asp-validation-summary="All" class="alert alert-danger"></div>
    }
    else if (TempData["Submit"] != null)
    {
        <div class="alert alert-success">
            <h4><i class="fa fa-check-circle"></i> 邮件已发送，请查收。</h4>
        </div>
    }

    <div class="form-group">
        <div class="row">
            <label class="col-2 text-right">收件人邮箱</label>
            <input class="form-control col-6" name="Receiver" value="@(User.Identity.Get<string>("Email"))"/>
        </div>
    </div>
    
    <div class="form-group">
        <button class="btn btn-primary" type="submit">发送测试邮件</button>
    </div>
</form>